#7-1 排序输出字典中数据【组合数据类型】
# dic1 = {'Tom':21,'Bob':18,'Jack':23,'Ana':20}
# dic2 = {'李雷':21,'韩梅梅':18,'小明':23,'小红':20}
# s=int(input())
# # s=2
# dic12=sorted(dic1.items(),key=lambda x:x[0],reverse=False)
# dic22=sorted(dic2.items(),key=lambda x:x[1],reverse=False)
# dic1Final=[]
# dic2Final=[]
# if s>len(dic12):
#     s=len(dic12)
# for i in range(s):
#     dic1Final.append(dic12[i][0])
#     dic2Final.append(dic22[i])
# print(dic1Final)
# print(dic2Final,end="")


#7-2 用户转账模拟【组合数据类型】
# dic={"aaa":["123456",10000],"bbb":["888888",5000],"ccc":["333333",3000]}
# name=input()
# if name in dic.keys():
#     money = int(input())
#     if money<=dic['aaa'][1]:
#
#         #转账金额
#         dic['aaa'][1]-=money
#         dic[name][1]+=money
#         print("Tranfer Success")
#         print("{}:{}".format("aaa",dic['aaa'][1]))
#         print("{}:{}".format(name,dic[name][1]))
#     else:
#         print("Insufficient Funds")
# else:
#     print("Wrong User")


#7-3 用户登录模拟【组合数据类型】
# dic={"aaa":["123456",10000],"bbb":["888888",5000],"ccc":["333333",3000]}
# finalTest=3
# name=input()
# if name in dic.keys():
#     # password = input()
#     while finalTest > 0:
#         password = input()
#         if dic[name][0] == password:
#             print("Success")
#             break
#         else:
#             finalTest -= 1
#             if finalTest > 0:
#                 print("Fail,{} Times Left".format(finalTest))
#                 # password = input()
#             else:
#                 print("Login Denied")
# else:
#     print("Wrong User")


#7-4 罗马数字转换【组合数据类型】
# def roman_to_int(s):
#     roman_dict = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000,
#                   'IV': 4, 'IX': 9, 'XL': 40, 'XC': 90, 'CD': 400, 'CM': 900}
#     result = 0
#     i = 0
#     while i < len(s):
#         if i+1 < len(s) and s[i:i+2] in roman_dict:
#             result += roman_dict[s[i:i+2]]
#             i += 2
#         else:
#             result += roman_dict[s[i]]
#             i += 1
#     return result
#
# # 输入罗马数字
# num = input()
# print(roman_to_int(num))


#7-5 字典翻转输出【组合数据类型】
# try:
#     input_str = input()
#     input_dict = eval(input_str)
#     output_dict = {v: k for k, v in input_dict.items()}
#     print(output_dict)
# except:
#     print("输入错误")


# 7-6 集合元素删除【组合数据类型】
# n_list = list(map(int, input().split()))
# N = int(input())
#
# s = set(n_list)
#
# for _ in range(N):
#     command = input().split()
#     if command[0] == 'pop':
#         if s:
#             s.pop()
#     elif command[0] == 'remove':
#         if int(command[1]) in s:
#             s.remove(int(command[1]))
#     elif command[0] == 'discard':
#         s.discard(int(command[1]))
#
# print(sum(s))

